# -*- coding: utf-8 -*-
from django.db import models


# Create your models here.


class BrandTag(models.Model):
    tag_name = models.CharField(max_length=100)

    def __str__(self):
        return self.tag_name


class Brand(models.Model):
    brand_name_zh = models.CharField(max_length=100)
    brand_name_en = models.CharField(max_length=200)
    brand_logo = models.URLField(blank=True, null=True)
    show_name = models.CharField(max_length=100, verbose_name=u'品牌名称')
    brand_tags = models.ManyToManyField(BrandTag)
    create_time = models.DateTimeField(auto_now_add=True)

    def __str__(self):
        return u'{brand_name=[%s, %s, %s],brand_logo=%s}' % (self.brand_name_zh, self.brand_name_en, self.show_name, self.brand_logo)

    class Meta:
        ordering = ['-brand_name_en']
